package com.dwms.feign.base;

import com.dwms.entity.PageResponse;
import com.dwms.entity.QueryRequest;
import com.dwms.entity.Result;
import com.dwms.entity.base.warehouse.request.WarehouseQueryRequest;
import com.dwms.entity.base.warehouse.request.WarehouseRequest;
import com.dwms.entity.base.warehouse.response.WarehouseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName: WarehouseController
 * @Description: Warehouse
 * @Create 2025-08-27 14:40:44
 * @Author WH
 * @Since 1.0.0
**/
@FeignClient(value = "base-server", path = "/warehouse")
public interface WarehouseFeignClient {
    /**
     * 保存
     *
     * @param warehouseRequest
     *          请求参数
     * @return
     */
    @PostMapping("/save")
    Result save(@RequestBody WarehouseRequest warehouseRequest);

    /**
     * 修改
     *
     * @param warehouseRequest
     *          请求参数
     * @return
     */
    @PostMapping("/update")
    Result update(@RequestBody WarehouseRequest warehouseRequest);
    

    /**
     * 分页查询
     *
     * @param query
     *          查询参数
     * @return
     */
    @PostMapping("/findPage")
    Result<PageResponse<WarehouseResponse>> findPage(@RequestBody WarehouseQueryRequest query);

    /**
     *  根据ID查询
     *
     * @param query
     *          参数
     * @return
     */
    @PostMapping("/findById")
    Result findById(@RequestBody QueryRequest query);

    /**
     * 删除
     *
     * @param query
     *          ID
     * @return
     */
    @PostMapping("/delete")
    Result delete(@RequestBody QueryRequest query);

    /**
     * 查询列表
     * @param query
     * @return
     */
    @PostMapping("/findList")
    Result<List<WarehouseResponse>> findList(@RequestBody WarehouseQueryRequest query);

}
